package com.example.demo.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.dao.UserDao;
import com.example.demo.domain.User;

@RestController
public class UserController {

	
	@Autowired
	private UserDao userDao;
	
	@RequestMapping(value="/users",produces="application/json;charset=UTF-8")
    public List<User> index() {
		List<User> list=userDao.findAll();
		return list;
    }
	
	
}
